from flask import Blueprint, request, jsonify
import pandas as pd

read_excel = Blueprint("read_excel", __name__)


@read_excel.route('/read_excel', methods=["POST"])  # 定义路由
def read():
    file_name = "处理数据.xlsx"
    data_frame = pd.read_excel(file_name, sheet_name="Sheet1")
    tolist = data_frame.apply(lambda row:{"问题": row['问题']}, axis=1).tolist()
    print(type(tolist))
    return tolist
